<template>
  <div>
    <p v-red>我是v-red指令</p>
    <p v-bg="'pink'">我是v-bg指令</p>
    <p v-bg="'yellow'">我是v-bg指令</p>
    <p v-red>我是v-red指令</p>
    <p>我是v-red指令</p>
  </div>
</template>
<script>
export default {
  name: 'App',

  directives: {
    red(el) {
      el.style.background = 'red';
    },

    bg(el, binding) {
      el.style.background = binding.value;
    },
  },
};
</script>
<style></style>
